package common;

import javax.servlet.http.HttpServletRequest;

import util.MobileUtil;

public class Access {

	public final static String WEB = "web";
	public final static String WAP = "wap";

	public static String access(HttpServletRequest request) {
		if (request.getServerName().indexOf("localhost") >= 0 ) {
			return WEB;
		}
		if(request.getServerName().indexOf("127.0.0.1") >= 0 ){
			return WAP;
		}
		if(!MobileUtil.isMoblie(request)){
			return WEB;
		}
		if(MobileUtil.isMoblie(request)){
			return WAP;
		}
		return WEB;
	}
}
